/*
*用途：数据库链接信息
*作者：hwq
*创建日期：2019-01-14 16:50
*/
const Sequelize = require('sequelize')
const sequelize = new Sequelize('vuecms', 'root', 'root', {
  host: 'localhost',
  dialect: 'mysql',
  pool: {
    max: 5,
    min: 0,
    acquire: 30000,
    idle: 10000
  },
})

sequelize
  .authenticate()
  .then(() => {
    console.log('连接数据库成功！');
  })
  .catch(err => {
    console.error('无法链接数据库:', err);
  });

module.exports = sequelize